package com.hmall.api.trade;

import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class TradeClientFallbackFactory implements FallbackFactory<TradeClient> {
    @Override
    public TradeClient create(Throwable cause) {
        return new TradeClient(){
            @Override
            public void markOrderPaySuccess(Long orderId) {
                log.warn("订单支付成功失败, 执行降级策略");
            }
        };
    }
}
